home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / LITTLE / TOOLKIT.ZIP / DOCS / PROGRAM.TXT < prev    next >
Encoding:
Text File  |  1996-12-04  |  3.7 KB  |  73 lines

  1.  
  2. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
  3.                MC68040 ToolKit - programming details
  4. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*
  5.  
  6. Direct access to the MMU tree is implemented via the 'XMMU' cookie. This
  7. cookie is filled out with a longword pointer to a short structure which
  8. contains useful addresses & routines for use by external programs. All
  9. the routines listed here should be called from supervisor mode. Avoid
  10. modifying pages assigned to locations used by the current ISP/USP.
  11.  
  12. The XMMU cookie structure uses the following format:
  13.  
  14. Offset:        Name/purpose:
  15.  
  16. 0        PMMU root table pointer (512-byte aligned). This address
  17.                 should also be contained in the URP & SRP root-pointer
  18.                 registers after the driver is installed.
  19.  
  20. 4        PMMU tree end address. This address points to the first
  21.                 memory location NOT used by the PMMU tree. 
  22.                 
  23. 8        Read pages. This is a pointer to a subroutine which can
  24.                 be used to 'record' the page attributes of a block of
  25.                 memory between registers 'a0' and 'a1'. Page attributes
  26.                 are recorded into a buffer indicated by register 'a2'.
  27.                 One longword is stored in the buffer for every 8-KByte
  28.                 page overlapping the address range indicated by registers
  29.                 'a0' and 'a1'. The block end address - 'a1' - is assumed
  30.                 to point to the first location NOT included in the block.
  31.                 Because these pages are 8kb in size, this routine will
  32.                 record attributes for any page overlapping the block
  33.                 specified - even if the page is not contained entirely
  34.                 within that block.
  35.                 
  36. 12        Write pages. Identical to 'read pages', but in reverse.
  37.                 This must be used to restore page attributes when your
  38.                 program terminates. Again, a0/a1/a2 are used to indicate
  39.                 block start, end and the attribute buffer respectively.
  40.  
  41. 16        Set pages to 'write-through' cache mode. Similar to
  42.                 'write pages', except the only thing that changes in
  43.                 the page attributes is the cache mode - and a source
  44.                 buffer is not required. This can be used to ensure an
  45.                 area of memory is cacheable, but is not using copyback
  46.                 mode.
  47.                 
  48. 20        Set pages to 'copyback' cache mode. Identical to the
  49.                 'write-through' version described above, except the
  50.                 cache mode is different. Can be used to accelerate all
  51.                 access to BSS storage segments and program stack space.
  52.  
  53. 24        Set pages to 'serialized' cache mode. This mode means
  54.                 the memory is not cacheable, but the data is written
  55.                 to ram in the same order specified by the instruction
  56.                 sequence. This is important if you are marking new
  57.                 hardware registers not present in the usual Falcon HW
  58.                 register space - like the Nova card.
  59.  
  60. 28        Set pages to 'non-serialized' cache mode. Identical to
  61.                 the 'serialized' mode described above, except this time
  62.                 the data can be written back to ram out-of-order to
  63.                 take advantage of long-latency operations & optimised
  64.                 68040 bus situations.
  65.  
  66.                 
  67. Notes:        The idea is this: Record the page attributes of the
  68.                 memory you want to edit using 'read pages'. Change the
  69.                 page attributes using the copyback routine (or whatever)
  70.                 and then use 'write-pages' to put the attributes back
  71.                 when you have finished.
  72.                 
  73.